<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>配置项xAxis</title>
  <script src="./echarts.js"></script>
  <style lang="css">
    #chart1, #chart2 {
      width: 100%;
      height: 500px;
      border: 1px solid red;
      float: left;
    }
  </style>
</head>
<body>
  <div id="chart1"></div>
  <div id="chart2"></div>

  <script>
    const myChart1 = echarts.init(document.getElementById('chart1'));

    myChart1.setOption({
      title: {
        text: '当月销售量',
      },
      legend: { // 图例
        data: ['昨日销量', '今日销量', '明日销量']
      },
      xAxis: [
        { data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'] },
        { data: ['衬衫1', '羊毛衫1', '雪纺衫1', '裤子1', '高跟鞋1', '袜子1'] },
        { data: ['衬衫2', '羊毛衫2', '雪纺衫2', '裤子2', '高跟鞋2', '袜子2'], offset: -150 },
      ],
      yAxis: {
        splitLine: {
          show: false
        }
      },
      series: [
        {
          name: '昨日销量',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20]
        },
        {
          name: '今日销量',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20]
        },
        {
          name: '明日销量',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20]
        },
      ]
    })
  </script>
</body>
</html>